<template>
  <div class="icon-container">
    <i :class="`iconfont ${iconClass}`"></i>
  </div>
</template>

<script>
const classMap = {
  home: "iconzhuye",
  success: "iconzhengque",
  error: "iconcuowu",
  close: "iconguanbi",
  warn: "iconjinggao",
  info: "iconxinxi",
  blog: "iconblog",
  code: "iconcode",
  about: "iconset_about_hov",
  weixin: "iconweixin",
  mail: "iconemail",
  github: "icongithub",
  qq: "iconsign_qq",
  arrowUp: "iconiconfonticonfonti2copy",
  arrowDown: "iconiconfonticonfonti2",
  empty: "iconempty",
  chat: "iconliuyan",
};

export default {
    props: {
        type: {
            type: String,
            required: true,
        }
    },
  computed: {
    iconClass(){
        return classMap[this.type];
    }
  },
};
</script>

<style scoped lang="less">
@import "../styles/iconfont.less";

.icon-container {
    .iconfont{
        font-size: inherit;
        color: inherit;
    }
}
</style>